#! /bin/bash

error=0 ; trap "error=$((error|1))" ERR

# add a demo user account
if ! $ROOTCMD getent passwd demo ; then
    $ROOTCMD adduser -c "fai demo user" demo
    $ROOTCMD usermod -p "$ROOTPW" demo
fi

# enable graphical login screen, make run level 5 as default
if [ -f $target/usr/sbin/gdm ]; then
    sed -i -e 's/id:3:initdefault:/id:5:initdefault:/' $target/etc/inittab
    # do not run this tool
    echo "RUN_FIRSTBOOT=NO" > $target/etc/sysconfig/firstboot
fi

exit $error

